<template>
	<view class="container bg-w">
		<view class="header uni-flex uni-row flex-between">
			<uni-nav-bar title="项目基础信息">
				<template slot='left'>
					<view class="flex width-100 ">
						<i class='iconfont iconfanhui' @click='goBack()'></i>
					</view>
				</template>
			</uni-nav-bar>
		</view>
		<view class="basic-information position-r-top">
			<view class="project-overview">
				<text class="order">项目概况</text>
				<uni-list-item  title="项目编号" :rightText="BasicInfo.projectNumber"></uni-list-item>
				<uni-list-item  title="项目名称" :rightText="BasicInfo.projectName"></uni-list-item>
				<uni-list-item  title="项目标段" :rightText="BasicInfo.tendersDesc"></uni-list-item>
				<uni-list-item  title="建设期次" :rightText="BasicInfo.buildPeriodDesc"></uni-list-item>
				<uni-list-item  title="备案号" :rightText="BasicInfo.recordNo"></uni-list-item>
			</view>
			<view class="project-configuration">
				<text class="order">项目配置</text>
				<uni-list-item  title="考核模板" :rightText="BasicInfo.assessmentName"></uni-list-item>
				<uni-list-item  title="项目状态" :rightText="BasicInfo.statusDesc"></uni-list-item>
				<uni-list-item  title=" 总质评分" :rightText="JSON.stringify(BasicInfo.score)"></uni-list-item>
			</view>
			<view class="project-supervisor" v-for="(item,index) in BasicInfo.participates" :key="index">
				<text class="order">{{item.typeName}}</text>
				<uni-list-item  title="单位名称" :rightText="item.orgName"></uni-list-item>
				<uni-list-item  title="单位负责人" :rightText="item.superviseUserName"></uni-list-item>
				<uni-list-item  title=" 联系方式" :rightText="item.contactWay" ></uni-list-item>
				<uni-list-item  title=" 监督员" :rightText="item.chargeUser"></uni-list-item>
			</view>
			<view class="project-other">
				<text class="order">其他</text>
				<uni-list-item  title="工程概况" :rightText="BasicInfo.projectSurvey"></uni-list-item>
				<uni-list-item  title="工程措施" :rightText="BasicInfo.projectMeasures"></uni-list-item>
				<uni-list-item  title="计划验收时间" :rightText="BasicInfo.planCheckTime"></uni-list-item>
				<uni-list-item  title="计划归档时间" :rightText="BasicInfo.planArchiveTime"></uni-list-item>
				<uni-list-item  title="计划竣工时间" :rightText="BasicInfo.completedTime"></uni-list-item>
				<uni-list-item  title="水印模板" :rightText="waterName"></uni-list-item>
				<uni-list-item  title="备注" :rightText="BasicInfo.remarks"></uni-list-item>
			</view>
		</view>
	</view>
</template>

<script>
	import { projectInfo,entityType,zdhjcsubassessment,waterManagement } from '@/common/api/map.js'
	export default {
		data() {
			return {
				BasicInfo:{},
				entityTypeAll:[],
				page:{
					pageSize:100,
					pageNo:1
				},
				waterName: ''
			}
		},
		onLoad(option) {
			entityType().then(res=>{
				this.entityTypeAll = res.data
			})
			projectInfo(option.projectId).then(res => {
				if(res.data){
					this.BasicInfo = res.data
					if(this.BasicInfo.assessmentId){
						zdhjcsubassessment(this.page).then(res => {
							if(res.data.records){
								res.data.records.forEach(obj => {
									if(obj.assessmentId == this.BasicInfo.assessmentId){
										this.$set(this.BasicInfo,'assessmentName',obj.assessmentName)
									}
								})
							}
						})
					}
					this.BasicInfo.participates.forEach(obj => {
						this.entityTypeAll.forEach(obj2 =>{
							if(obj.type == obj2.id){
								this.$set(obj,'typeName',obj2.label)
							}
						})
					})
					waterManagement(res.data.waterId).then(res=> {
						if(res.code == 20000) this.waterName = res.data.name;
					})
				}
			})
		},
		methods: {
			
		}
	}
</script>
